package freehorizons.engine;

import freehorizons.core.Attribute;

public class SimpleAttribute implements Attribute
{

	private final String name_;
	private final String tag_;
	private double value_;

	public SimpleAttribute( String name, String tag )
	{
		this( name, tag, 0.0 );
	}

	public SimpleAttribute( String name, String tag, double value )
	{
		name_ = name;
		tag_ = tag;
		value_ = value;
	}

	public void addValue( double value )
	{
		setValue( getValue( ) + value );
	}

	@Override
	public String getName( )
	{
		return name_;
	}

	@Override
	public String getTag( )
	{
		return tag_;
	}

	public double getValue( )
	{
		return value_;
	}

	public void scaleValue( double scalar )
	{
		setValue( getValue( ) * scalar );
	}

	public void setValue( double value )
	{
		value_ = value;
	}

}
